package com.gdhz.xiaohengqin.repository;

import com.gdhz.xiaohengqin.model.entity.SysConfig;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.LocalDateTime;

/**
 * @author Swallows
 * @date 2025-06-09 15:18
 */
public interface SysConfigRepository extends R2dbcRepository<SysConfig, Long> {
    Mono<SysConfig> findByParamKey(String paramKey);

    @Query("SELECT * FROM sys_config WHERE update_time > :lastLoadTime")
    Flux<SysConfig> findModifiedAfter(LocalDateTime lastLoadTime);
}
